package com.gzc.pm.ro;

import java.util.List;

import com.gzc.pm.bean.KnowledgeLibBean;
import com.gzc.pm.dao.KnowledgeLibDao;
import cn.skyclass.net.OperationResult;

public class KnowledgeLibRo {
	
	public OperationResult insert(KnowledgeLibBean bean){
		KnowledgeLibDao dao = new KnowledgeLibDao();
		return dao.insert(bean);
	}
	
	public OperationResult deleteById(int id){
		KnowledgeLibDao dao = new KnowledgeLibDao();
		return dao.deleteById(id);
	}
	
	
	
	public int getCountByCondition(String title, String keyWord, String productName){
		KnowledgeLibDao dao = new KnowledgeLibDao();
		return dao.getCountByCondition(title, keyWord, productName);
	}
	
	public List<KnowledgeLibBean> getInfoByCondition(String title, String keyWord, String productName, int pageNo, int pageSize){
		if(title == ""){
			title = null;
		}
		if(keyWord == ""){
			keyWord = null;
		}
		if(productName == ""){
			productName = null;
		}
		KnowledgeLibDao dao = new KnowledgeLibDao();
		return dao.getInfoByCondition(title, keyWord, productName, pageNo, pageSize);
	}
}
